<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
    <title>消息管理</title>
    <meta name="decorator" content="default"/>
    <link href="${ctxStatic}/static_back/css/public.css" type="text/css" rel="stylesheet">
    <link href="${ctxStatic}/static_back/css/main.css" type="text/css" rel="stylesheet">
</head>

<body>
    <%--标题--%>
    <div class="top-section">
        <h2>消息列表</h2>
    </div>

    <div class="body-section white-body">
        <%--功能区--%>
        <form:form id="searchForm" modelAttribute="airRealtimeMessage" action="${ctx}/air/airRealtimeMessage/" method="post" >
            <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
            <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
            <div class="function-box">
                <div class="left-function">
                    <%--todo 缺时间筛选，默认选择当天--%>
                    <input id="beginDate" name="feedbackDate" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate"
                               value="<fmt:formatDate value="${feedDate}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
                    <form:select path="airRidePoint.id" htmlEscape="false">
                        <form:option value="" label="全部服务站点"/>
                        <form:options items="${rides}" itemLabel="name" itemValue="id"/>
                    </form:select>
                    <form:select path="type">
                        <form:option label="全部类型" value=""/>
                        <form:options items="${fns:getDictList('message_type')}" itemLabel="label" itemValue="value"
                                      htmlEscape="false"/>
                    </form:select>
                    <input id="btnSubmit" class="btn btn-main" type="submit" value="查询"/>
                </div>
                <div class="right-function">
                </div>
            </div>
        </form:form>
        <sys:message content="${message}"/>

        <%--表格区--%>
        <div class="table-box">
            <table id="contentTable">
                <thead>
                <tr>
                    <th width="10%" style="text-align: left">时间</th>
                    <th width="14%" style="text-align: left">相关站点</th>
                    <th width="12%" style="text-align: left">汇报人</th>
                    <th width="12%" style="text-align: left">类型</th>
                    <th width="18%" style="text-align: left">标题</th>
                    <th style="text-align: left">补充说明</th>
                </tr>
                </thead>
                <tbody>
                <c:forEach items="${page.list}" var="airRealtimeMessage">
                    <tr>
                        <td>
                                <fmt:formatDate value="${airRealtimeMessage.feedbackDate}" type="time"/>
                        </td>
                        <td>
                                ${airRealtimeMessage.airRidePoint.name}
                        </td>
                        <td>
                                ${airRealtimeMessage.airWorker}
                        </td>
                        <td>
                                ${airRealtimeMessage.typeString()}
                        </td>
                        <td>
                                ${airRealtimeMessage.title}
                        </td>
                        <td>
                                ${airRealtimeMessage.note}
                        </td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
            <div class="pagination table-pagination">${page}</div>
        </div>
    </div>


    <script type="text/javascript">
        function page(n, s) {
            $("#pageNo").val(n);
            $("#pageSize").val(s);
            $("#searchForm").submit();
            return false;
        }
    </script>
</body>
</html>